\usemodule[zhfonts]
\defineframed
  [SnailBox]
  [frame=off, width=6cm, autowidth=force,
    align={middle, lohi, broad}, offset=overlay]

\startMPpage
input snail.mp;
% 构造结点
Node a, b, c, d, e;
a := io("\SnailBox{$i\leftarrow 1$\\$s\leftarrow 0$}");
b := proc("$s\leftarrow s + i$");
c := other("$i > 100$", diamond(b));
d := proc("$i\leftarrow i + 1$");
e := io("\SnailBox{$s$}");
% 结点定位
as_planet(b, a, "bottom"); as_planet(c, b, "bottom");
as_planet(d, c, "right"); as_star(e, c, "bottom");
% 绘制结点
draw_each a, b, c, d, e;
% 为结点增加常规锚点
enrich_each a, b, d, e;
% 绘制连接
flow_each a => b, b => c, walk(d.N, (_n_ _v_(d.N, b.E)), b.E);
tagged_flow("是", "right", .4) c => e;
tagged_flow("否", "top", .4) c => d;
\stopMPpage